import unittest

class Demo1TeatCase(unittest.TestCase):
    def test1(self):
        print('test1')

    def test2(self):
        print('test2')

class Demo2TestCase(unittest.TestCase):
    def testa(self):
        print('testa')

    def testb(self):
        print('testb')

if __name__ == '__main__':
    # TODO 测试套件
    # TODO addTests
    # 创建suite对象
    suite = unittest.TestSuite()
    tests = [
        Demo1TeatCase('test1'),
        Demo2TestCase('testb'),
        Demo1TeatCase('test2')
    ]
    # for test in tests:              # suite.addTests()   源码
    #    suite.addTest(test)


    suite.addTests(tests)